package com.meiya.baseweb.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement
public class Opinion extends BasicEntity {
	/**
	 * 观点
	 */
	private static final long serialVersionUID = 1L;

	private String domain; // 观点领域
	private String title; // 标题
	private String summary; // 摘要
	private Integer sentiment; // 倾向

	@OneToOne(cascade = CascadeType.REFRESH)
	@JoinColumn(name = "thePubopinion")
	@NotFound(action = NotFoundAction.IGNORE)
	public Pubopinion thePubopinion; // 舆情信息

	public String getDomain() {
		return domain;
	}

	public void setDomain(String domain) {
		this.domain = domain;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public Integer getSentiment() {
		return sentiment;
	}

	public void setSentiment(Integer sentiment) {
		this.sentiment = sentiment;
	}

	@XmlTransient
	public Pubopinion getThePubopinion() {
		return thePubopinion;
	}

	public void setThePubopinion(Pubopinion thePubopinion) {
		this.thePubopinion = thePubopinion;
	}

}
